package com.kelaite.procurement.entity;

// Generated 2016-3-6 15:13:23 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 * 招标信息 TPipelineHeader generated by hbm2java
 */
@Entity(name = "t_pipeline_header")
public class TPipelineHeader extends TBaseEntity {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id")
	private Long id;

	@ManyToOne(cascade = CascadeType.REFRESH, optional = false)
	@JoinColumn(name = "company_id")
	private TCompany tCompany;

	@ManyToOne(cascade = CascadeType.REFRESH, optional = true)
	@JoinColumn(name = "demand_id", nullable = true)
	@NotFound(action = NotFoundAction.IGNORE)
	private TDemand tDemand;

	@Column(name = "description")
	private String description;

	@Column(name = "gmt_create_time")
	private Date gmtCreateTime;

	@Column(name = "gmt_update_time")
	private Date gmtUpdateTime;

	@Column(name = "created_by")
	private String createdBy;

	@Column(name = "updated_by")
	private String updatedBy;

	@Column(name = "is_delete", length = 1)
	private Integer isDelete; // 0：未删除, 1已删除

	@OneToMany(mappedBy = "tPipelineHeader", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@OrderBy(value = "id ASC")
	private Set<TPipelineItem> tPipelineItems = new HashSet<TPipelineItem>();

	@OneToMany(mappedBy = "tPipelineHeader", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@OrderBy(value = "id ASC")
	private Set<TPipelinePublic> tPipelinePublics = new HashSet<TPipelinePublic>();

	public TPipelineHeader() {

	}

	public Long getId() {

		return id;
	}

	public void setId(Long id) {

		this.id = id;
	}

	public TCompany gettCompany() {

		return tCompany;
	}

	public void settCompany(TCompany tCompany) {

		this.tCompany = tCompany;
	}

	public String getDescription() {

		return description;
	}

	public void setDescription(String description) {

		this.description = description;
	}

	public Date getGmtCreateTime() {

		return gmtCreateTime;
	}

	public void setGmtCreateTime(Date gmtCreateTime) {

		this.gmtCreateTime = gmtCreateTime;
	}

	public Date getGmtUpdateTime() {

		return gmtUpdateTime;
	}

	public void setGmtUpdateTime(Date gmtUpdateTime) {

		this.gmtUpdateTime = gmtUpdateTime;
	}

	public String getCreatedBy() {

		return createdBy;
	}

	public void setCreatedBy(String createdBy) {

		this.createdBy = createdBy;
	}

	public String getUpdatedBy() {

		return updatedBy;
	}

	public void setUpdatedBy(String updatedBy) {

		this.updatedBy = updatedBy;
	}

	public Integer getIsDelete() {

		return isDelete;
	}

	public void setIsDelete(Integer isDelete) {

		this.isDelete = isDelete;
	}

	public Set<TPipelineItem> gettPipelineItems() {

		return tPipelineItems;
	}

	public void settPipelineItems(Set<TPipelineItem> tPipelineItems) {

		this.tPipelineItems = tPipelineItems;
	}

	public Set<TPipelinePublic> gettPipelinePublics() {

		return tPipelinePublics;
	}

	public void settPipelinePublics(Set<TPipelinePublic> tPipelinePublics) {

		this.tPipelinePublics = tPipelinePublics;
	}

	public TDemand gettDemand() {
		return tDemand;
	}

	public void settDemand(TDemand tDemand) {
		this.tDemand = tDemand;
	}

}
